home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 109
/
109.d81
/
tower test
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
10KB
|
468 lines
10 poke56,56:poke51,0:clr:poke53272,31
11 poke53280,0:poke53281,0:w$=""
12 ad=49152:dv=peek(186):ifdv<8thendv=8
13 n=20:dimq$(n,14),a$(n),ck(n),ck$(n)
14 gosub7000
19 gosub1000:gosub1100:gosub1300
20 fori=1ton:ck$(i)=" ":next
21 fori=1ton:ck(i)=0:next
23 sysad+18,10,7,20,4,1,1
24 sysad+33
25 poke214,7:print:printtab(12)"[212]he [212]ower [212]est
26 [153][163]12)"(NULL)ee atnnswers "
27 [153][163]12)"right$nstructions"
28 [153][163]12)"(NULL)(NULL)atnstr$(NULL)(NULL)atn(NULL) "
30 [158]ad[170]12,11,8,30,4,1,3
35 k[178][194](828)
36 h$[178]"tower instr":[139]k[178]2[167]h$[178]"tower answr"
37 [145]k[141]100,8000,8000,9000
40 [137]20
45 :
100 sc[178]0:x[178]1
105 [158]ad[170]3,1:[141]1000
106 [141]1200:[141]1400
108 [158]ad[170]15,2,4,38,19,160,15
109 [151]214,3:[153]
110 [158]ad[170]33:[129]i[178]1[164]14:[153]"list"q$(x,i):[130]
115 [151]214,18:[153]:[153]"listatn(NULL)(NULL)(NULL)val(NULL): ";
120 [161]w$:[139]w$[178]""[167]120
125 [143]print"list"w$
130 [139]w$[178]"m" [167][158]ad[170]6,1:[142]:[143] menu
140 [139]w$[178]"p"[167][158]ad[170]27,1,4,38,20,7:[143] print
150 [139]w$[178]"on"[167]x[178]x[171]1:[139]x[179]1[167]x[178]1
155 [139]w$[178]""[167]173
160 [139]w$[178]"on" [176]w$[178]""[167]106
161 [139]w$[179]"a"[176]w$[177]"d"[167]115
170 [139]w$[179][177]a$(x)[167]175
171 ck$(x)[178]"sqr":[139]ck(x)[178]0[167]sc[178]sc[170]10:ck(x)[178]1:[141]1200
172 [141]3000
173 x[178]x[170]1:[139]x[177]n [167] [141]2000:[142]
174 [137]106
175 ck(x)[178]2:[141]4000
180 [137]109
1000 [153]"loadortantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantan^";
1005 [153]"(NULL)cont wait(NULL)";
1010 [153]"-tantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantan<";
1015 [129]i[178]1[164]18:[153]"(NULL)list wait(NULL)";:[130]
1020 [153]"-tantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantan<";
1025 [153]"(NULL)print wait(NULL)";
1030 [153]"/tantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantanexp";:[158]ad[170]33
1035 [142]
1040 :
1100 [151]214,0:[153]:[153][163]10)"cont(NULL) (NULL) (NULL) val (NULL) (NULL) val (NULL) (NULL)":[142]
1200 [151]214,0:[153]:[153]"cont(NULL)(NULL)(NULL)val(NULL) (NULL)val(NULL)(NULL) (NULL)(NULL)val(NULL)(NULL)right$(NULL)(NULL):"[170][201](" "[170][196](x),2);
1205 [153]ck$(x)[170]" (NULL)len(NULL)(NULL)val:"[170][201](" "[170][196](sc),3)
1210 [142]
1300 [151]214,21:[153]:[153]"print (NULL)se len(NULL)(NULL)(NULL) keys/(NULL)val(NULL)(NULL)(NULL)(NULL) to (NULL)elect":[142]
1400 [151]214,21:[153]:[153]"print (NULL)-(NULL)enu \-(NULL)ext ^-(NULL)revious (NULL)-(NULL)rint"
1405 [142]
2000 [158]ad[170]3,0
2005 [158]ad[170]18,4,7,30,7,4,1
2010 [158]ad[170]21,"(NULL)val(NULL)(NULL) (NULL)(NULL)val(NULL)!",8,4,1
2011 [158]ad[170]24,"(NULL)len(NULL)(NULL)val:"[170][196](sc),15,10,4,1
2012 rk$[178]"(NULL)(NULL)atn(NULL)close(NULL)valatn(NULL)"
2013 [139]sc[177]40[167]rk$[178] "val(NULL)val(NULL)atn(NULL)(NULL)(NULL) (NULL)(NULL)val(NULL)atn(NULL)(NULL)(NULL)"
2014 [139]sc[177]80[167]rk$[178] "(NULL)atn(NULL)(NULL)atn (NULL)atn(NULL)(NULL)(NULL)val(NULL)"
2015 [139]sc[177]120[167]rk$[178]"(asc(NULL)(NULL)) asc(NULL)right$val(NULL)str$ (NULL)asc (NULL)(NULL)valval(NULL)"
2016 [139]sc[177]160[167]rk$[178]"(asc(NULL)asc) asc(NULL)right$val(NULL)str$ (NULL)asc ascval(NULL)str$val(NULL)"
2020 [158]ad[170]24,"(NULL)atn(NULL)(NULL): "[170]rk$,6,12,4,1
2021 [158]ad[170]21,"(NULL)ress (NULL)val(NULL)(NULL)(NULL)(NULL)",14,4,1
2022 [141]51300
2023 [161]k$:[139]k$[179][177][199](13)[167]2023
2024 [158]ad[170]6,1:[142]
2025 :
3000 [158]ad[170]3,0
3005 [158]ad[170]18,10,10,20,3,4,1
3010 [158]ad[170]21," (NULL)right$chr$left$(NULL)!",12,4,1
3015 [141]50760
3020 [158]ad[170]6,0:[142]
3025 :
4000 [158]ad[170]3,0
4005 [158]ad[170]18,10,10,20,3,10,1
4010 [158]ad[170]21," (NULL)(NULL)(NULL)(NULL)chr$!",12,10,1
4015 [141]52420
4020 [158]ad[170]6,0:[142]
4025 :
7000 [129]i[178]1[164]n
7005 [129]j[178]1[164]14
7010 [135] q$(i,j)
7015 [130]
7020 [135]a$(i):[130]
7025 [142]
7030 :
8000 [158]49152[170]3,1:[153]"load"[163]13)"def(NULL)left$val (NULL)(NULL)(NULL)val(NULL) (NULL)val(NULL)(NULL)"
8005 [158]49152[170]18,0,1,38,21,1,0
8015 [158]49152[170]33
8020 [158]49152[170]21,"(NULL)ress (NULL)val(NULL)(NULL)(NULL)(NULL) _ to valxit",24,13,0
8025 [159]2,dv,2,h$[170]",p,r":[158]49152[170]30,14
8030 [151]198,0
8035 [158]49152[170]21," (NULL)ress (NULL)val(NULL)(NULL)(NULL)(NULL) ",24,10,0
8040 [161]k$:[139]k$[179][177][199](13)[167]8040
8045 [151] 198,0
8050 [160]2:[158]49152[170]6,1:[142]
8055 :
9000 [158]ad[170]3,1
9005 [151]214,21:[153]:[153]"print (NULL)uit? atnre you sure? (y/n) "
9010 [161]k$:[139]k$[178]""[167]9010
9015 [139]k$[179][177]"y"[167][158]ad[170]6,1:[142]
9020 [137]40000
10000 [159]15,8,15,"s0:tower test":[160]15:[148]"0:tower test",8:[128]
11001 [131] "1] ascour people go to a baseball"
11002 [131] "game. (NULL)hey purchase tickets for four"
11003 [131] "seats in a row. lenhris agrees to sit"
11004 [131] "beside (NULL)om, but not next to peekill."
11005 [131] "right$f peekill refuses to sit beside mid$oe,"
11006 [131] "in what order (left to right) are"
11007 [131] "the four sitting?"
11008 [131] " "
11009 [131] "atn: lenhris, mid$oe, (NULL)om, peekill"
11010 [131] "peek: peekill, lenhris, mid$oe, (NULL)om"
11011 [131] "len: (NULL)om, mid$oe, lenhris, peekill"
11012 [131] "str$: mid$oe, lenhris, (NULL)om, peekill"
11013 [131] " "
11014 [131] " "
11015 [131] "d"
11016 :
12001 [131] "2] right$f a dog has a value of 1, and a"
12002 [131] "bulldog has a value of 2, what is"
12003 [131] "the value of a collie?"
12004 [131] " "
12005 [131] "atn: 2"
12006 [131] "peek: 3"
12007 [131] "len: 4"
12008 [131] "str$: 1"
12009 [131] " "
12010 [131] " "
12011 [131] " "
12012 [131] " "
12013 [131] " "
12014 [131] " "
12015 [131] "b"
12016 :
13001 [131] "3] (NULL)hat is the next character in the"
13002 [131] " following series?"
13003 [131] " "
13004 [131] " * [ * ( * $ * ] * ?"
13005 [131] " "
13006 [131] " "
13007 [131] "atn: $"
13008 [131] "peek: ("
13009 [131] "len: *"
13010 [131] "str$: )"
13011 [131] " "
13012 [131] " "
13013 [131] " "
13014 [131] " "
13015 [131] "d"
13016 :
14001 [131] "4] atn man decided to go shopping in a"
14002 [131] "store where there are no price tags,"
14003 [131] "but the store owner has a 'formula'"
14004 [131] "for calculating the price of each "
14005 [131] "item. right$f a hat costs $6, a shirt $10,"
14006 [131] "and a tie $6, how much would a belt"
14007 [131] "cost?"
14008 [131] " "
14009 [131] " "
14010 [131] "atn: $6"
14011 [131] "peek: $8"
14012 [131] "len: $10"
14013 [131] "str$: $12"
14014 [131] " "
14015 [131] "b"
14016 :
15001 [131] "5] (NULL)hat is the missing number in the"
15002 [131] " following sequence?"
15003 [131] " "
15004 [131] " 2,5,11,?,47,95"
15005 [131] " "
15006 [131] " "
15007 [131] " "
15008 [131] " "
15009 [131] " "
15010 [131] "atn: 23"
15011 [131] "peek: 31"
15012 [131] "len: 19"
15013 [131] "str$: 25"
15014 [131] " "
15015 [131] "a"
15016 :
16001 [131] "6] atn is to val as peek is to ?"
16002 [131] " "
16003 [131] " "
16004 [131] " "
16005 [131] " "
16006 [131] " "
16007 [131] " "
16008 [131] " "
16009 [131] " "
16010 [131] "atn: chr$"
16011 [131] "peek: len"
16012 [131] "len: str$"
16013 [131] "str$: (NULL)"
16014 [131] " "
16015 [131] "b"
16016 :
17001 [131] "7] right$f vald has 4 black socks and 8"
17002 [131] "white socks in his drawer, how many"
17003 [131] "socks does he need to pull out to"
17004 [131] "ensure that he has a pair of white"
17005 [131] "socks (assuming that vald is in the"
17006 [131] "dark)?"
17007 [131] " "
17008 [131] " "
17009 [131] " "
17010 [131] "atn: 2"
17011 [131] "peek: 4"
17012 [131] "len: 6"
17013 [131] "str$: 8"
17014 [131] " "
17015 [131] "c"
17016 :
18001 [131] "8] (NULL)hich numbers most reasonably"
18002 [131] " come ne